<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/adicional/templates/templateHome.xhtml">

	<ui:define name="tituloPagina">
		Alterar Endereço
	</ui:define>
	
	<ui:define name="conteudoCabecalho">
	
		<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/resources/js/clinica/alterarEnderecoFormulario.js">
		</script>
		
		<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/resources/js/clinica/clinica.js">
		</script>
		
	</ui:define>
	
	<ui:define name="conteudoCentro">
		<h:form id="formularioAlterarEndereco">
		
			<div>
				<p:messages showSummary="true" showDetail="true" closable="true"></p:messages>
			</div>
			
			<div class="ui-messages-error ui-corner-all campo_invisivel" id="containerErro">
					
					
			</div>
			
			<div>
				<h:outputLabel value="Logradouro da Clinica: " for="logradouroClinica" />
				<h:inputText value="#{clinica.logradouroClinicaAlt}" id="logradouroClinica" maxlength="200" 
				label="Logradouro da Clinica" binding="#{clinica.campoLogradouroClinicaAlt}"/>
			</div>
			
			<div>
				<h:outputLabel value="Bairro da Clinica: "  for="bairroClinica"/>
				<h:inputText value="#{clinica.bairroClinicaAlt}" id="bairroClinica" maxlength="150" 
				label="Bairro da Clinica" binding="#{clinica.campoBairroClinicaAlt}"/>
			</div>
			
			<div>
				<h:outputLabel value="Cep da Clinica: " for="cepClinica" />
				<h:inputText value="#{clinica.cepClinicaAlt}" id="cepClinica"  maxlength="8" 
				label="Cep da Clinica" binding="#{clinica.campoCepClinicaAlt}"/>
			</div> 
			
			<div>
				<h:outputLabel value="Complemento da Clinica: " for="complementoClinica"/>
				<h:inputText value="#{clinica.complementoClinicaAlt}" id="complementoClinica" maxlength="100" 
				label="Complemento da Clinica" binding="#{clinica.campoComplementoClinicaAlt}"/>
			</div>
			
			
			<div>
				<h:outputLabel value="Estados: " for="comboEstado" />
				<h:selectOneMenu value="#{clinica.codEstadoAlt}" binding="#{clinica.campoEstadoAlt}" id="comboEstado" label="Estados">
					
					<f:ajax event="change" listener="#{clinica.buscarCidadePorEstadoAlt}" render="comboCidade"></f:ajax>
					
					<f:selectItem itemValue="0" itemLabel="::SELECIONE::"/>
					<f:selectItems value="#{clinica.listaEstadosAlt}"/>
				
				</h:selectOneMenu>
			</div>
			
			<div>
				<h:outputLabel value="Cidades: " for="comboCidade"/>
				<h:selectOneMenu value="#{clinica.codCidadeAlt}" binding="#{clinica.campoCidadeAlt}" id="comboCidade" 
				label="Cidades" disabled="#{empty clinica.listaCidadesAlt}">
					
					<f:selectItem itemValue="0" itemLabel="::SELECIONE::"/>
					<f:selectItems value="#{clinica.listaCidadesAlt}"/>
				
				</h:selectOneMenu>
		  	</div>
			
			<div>
				<p:commandButton action="#{clinica.alterarEndereco()}" value="Enviar" onclick="return validarFormularioEnderecoAlt();" 
				update="@form"></p:commandButton>
				
				<p:commandButton action="#{clinica.limparFormularioAlterarEndereco}" value="Limpar" 
				onclick="return limparFormularioEmailAlt();" update="@form"
				immediate="true"></p:commandButton>
			</div>
		
		</h:form>
	</ui:define>
	
</ui:composition>
</html>